package com.example.controller;


import com.example.entity.User;
import io.swagger.annotations.ApiImplicitParam;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.*;

import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import io.swagger.annotations.ApiParam;

/* 类注解 */
@Api(tags = "用户crud测试")
@RestController
public class HelloController {

    /* 方法注解 */
    @ApiOperation(value = "方法描述", notes = "=======这是个值得注意的地方=========")
    @GetMapping(value="/hello")
    @ApiImplicitParam(paramType = "query",name= "name" ,value = "name",dataType = "string")
    //@ResponseBody
    public Object hello( String name) {

        return "Hello " + name + "!";
    }




    /* 方法注解 */
    @ApiOperation(value = "用户表", notes = "=======这是个值得注意的地方=========")
    @PostMapping(value="/user")
   // @ResponseBody
    public User user() {
        return new User();
    }
}